package com.yibai.web.app.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class AppController {

    /**
     * 资讯列表
     * @return
     */
    @GetMapping("/articles/{category}/{pageNo}.html")
    public String articleList(@PathVariable(name = "category") String category,
                              @PathVariable(name = "pageNo") Integer pageNo){
        System.out.println("category="+category);
        System.out.println("pageNo="+pageNo);
        return "article/list";
    }

    /**
     * 资讯详情
     * @return
     */
    @GetMapping("/article/{id}/")
    public String article(@PathVariable(name = "id") String id){
        System.out.println("id="+id);
        return "article/info";
    }

}
